I have this array with structure
I try to display the entries as a list
in my example I have 3 entries but instead of getting:
0 I Today
1 I Today
2 I Today
I get only the same entry 3 times
1 I Today
1 I Today
1 I Today
I have this array with structure
I try to display the entries as a list
in my example I have 3 entries but instead of getting:
0 I Today
1 I Today
2 I Today
I get only the same entry 3 times
1 I Today
1 I Today
1 I Today
Transaction[Index].Amount+"
"+Transaction[Index].Date+"
"+Transaction[Index].ID+"
"+Transaction[Index].Reason+"
"+Transaction[Index].Status+"
"+Transaction[Index].Type+"
"
When using for every child the 2nd variable (in your case DisplayIndex) contains the child. So, you can use DisplayIndex.Id and DisplayIndex.Date. Define DisplayIndex as the same structure then you can use the autocomplete.
Variable() and VariableString() haven’t been needed for awhile. They’re not needed and just make the events harder to read. You can just use the variable name.
The 1st variable is the variable being cycled through. The 2nd (optional) variable is the child. If the 1st variable is an array of numbers. The 2nd variable is a number. Since it’s an array of structures, it’s a structure. If it was an array of arrays, it would be an array. If the 1st variable is an array then the 3rd (optional) variable is the index. If the 1st variable is a structure then the 3rd variable would be the child’s name.
Is it showing nothing but index 1 or is it showing index 0? As is, it’s trying to use DisplayIndex as the index but it’s a structure. Since it’s a structure not a number, GD should be returning a zero for the index to prevent it from crashing. So, it should be showing index zero.
I changed to ZeroX4 way and it works fine, after I found I had a great mistake. When adding child I used “Id” and when trying to display them is used “ID” so it didn’t recognize it.
Now it works but I need one more help. How to filter. Example: Transactions.Type is “Expense” or “Income”. I would like to be able to see only Expenses etc
I really appreciate your fast replies! Thank you both!
I don’t understand your question
But if you have Transaction.Type
Then i would expect Keith to know better
But for me you should have
Transaction.Expense[0].ChildVar
Transaction.Income[0].ChildVar
And now you could display them same way i did
Transaction.Expense[Index].Amount+"
"+Transaction.Expense[Index].Date+"
"+Transaction.Expense[Index].ID+"
"+Transaction.Expense[Index].Reason+"
"+Transaction.Expense[Index].Status+"
"+Transaction.Expense[Index].Type+"
"
It is like a transactions log of a Bank.
With the list I created with your help it shows all the transactions. The question is how to filter what to display. I would like to add a button “Expenses”. When it is clicked I want to display only Expenses and no Income entries. the type of the transactions (if it is Expense or Income) is stored here:
Transaction[Index].Type
You mean I should split in 2 structures instead of 1? One Expenses and one income?
I would
Cause idk how to filter it otherwise
I would assume Keith would have idea how to filter it so feel free to ask him
To filter it add a condition to check the value. Compare the .type to another variable so you can reuse the events. You could use another variable for the child name so you can choose that as well. You could use an OR and if the search text is empty then it would show everything.
Something like this.
Now, since some columns are numbers and some text, you would need seperate events based on the search field or make everything text and convert to a number when needed.
If it’s a name compare texts. If it’s a number compare by number.
You could also use contains instead of equals for partial matching. For numbers you could add a range.
Using contains. “Pa” matches “Paul”.
If the user is typing the search item then you probably want to convert everything to lower case.
To use the ToLowerCase() expression, you need to use compare 2 strings condition instead of the variable condition .
It works great! Thank you very much for the help!