I have requirement getting value from CDS table.
1
2
3
1a
2a
3a
1b
2b
3b
I check some condition if 1 fails I will get 1a value if 1a fails I will get 1b value like that 2 and 3 so I need nested while or for loop like that java or JavaScript how can I achieve this in PowerApps then I have to check multiple conditions.
Solved! Go to Solution.
Hi @Gelos ,
I did a test for you.
1\ Add a button control and set its onselect property to:
ClearCollect(Col,{Value:"1",No:43},{Value:"2",No:55},{Value:"3",No:6},{Value:"1a",No:22},{Value:"2a",No:43},{Value:"3a",No:43},{Value:"1b",No:20},{Value:"2b",No:78},{Value:"3b",No:100},{Value:"1c",No:60},{Value:"2c",No:1},{Value:"3c",No:94})
For example: I want to find the first record that starts with 1 and meets the condition.
Condition: No >58
Add a label control and set its Text property to:
First(Filter(Col,"1" in Value,No>58)).Value
The result is as follows:
Best Regards,
Wearsky
Hi @Gelos,
As I pointed out on another thread, Power Apps does not have a For or While looping function like Javascript or VB.
If you can share more about how the logic you want your app to use to decide on which value to pull from your table, we can help you design an appropriate statement/statements to do that.
Regards,
Bryan
Hi @Gelos ,
I did a test for you.
1\ Add a button control and set its onselect property to:
ClearCollect(Col,{Value:"1",No:43},{Value:"2",No:55},{Value:"3",No:6},{Value:"1a",No:22},{Value:"2a",No:43},{Value:"3a",No:43},{Value:"1b",No:20},{Value:"2b",No:78},{Value:"3b",No:100},{Value:"1c",No:60},{Value:"2c",No:1},{Value:"3c",No:94})
For example: I want to find the first record that starts with 1 and meets the condition.
Condition: No >58
Add a label control and set its Text property to:
First(Filter(Col,"1" in Value,No>58)).Value
The result is as follows:
Best Regards,
Wearsky
Thank you for that
User | Count |
---|---|
19 | |
15 | |
14 | |
10 | |
8 |
User | Count |
---|---|
40 | |
30 | |
23 | |
22 | |
16 |