Good morning, I'm really a newbie with powerapps and I'm getting crazy with FX syntax.
I'm more a powershell user and often I try to perform actions following a PS logic but this doesn't works fine with Power Apps.
I need the develop an app that interact with a sharepoint list, it create a new row with the selected answers to the dropdown boxes and text inputs fullfilled by the user.
I need to populate some of the dropboxes based upon some conditions such as the user identity.
I have several columns but I will reduce to the minimum the fields for the example because when I will identify the correct syntax it would be used for each other column
I have the following SP list:
Cars:
| Title(licenseplate) | IsActive | User | Done | Model | Date | KM |
| text type | choice type | LookUp(Users.Title) | yes/no type | text type | date type | number type |
Users:
| Title(email) | Display Name |
| text type | text |
each user have one or more cars assigned to him, each car can be assigned to one user only.
each car have an "isactive" choice field that can be set as "active/pause/dismissed"
each car have a "done" yes/no field
for the user identity I thought to use "Office365Users.MyProfile().mail" property
my first need is button with that kind of logic:
if there is at least one car assigned to the user connected to the app that have the field "isactive" to "ACTIVE" and field "Done" in "NO" state, app will navigate to screen1 otherwise app will navigate to screen4
this because if the car is in "pause" or "dismissed" user don't have to do anything and goes to the last screen, for the "active" cars if the "Done" is in "NO" state user need to perform an action otherwise app will go straight to last screen.
My second need is a dropdownbox populated with all the license plate assigned to the user that are both isactive.Active and Done.NO
that's because user will perform an action one licenseplate at the time, when done, the connected flow or the app itself will change state to the "Done" field from "No" to "Yes" and then if there are more licenseplate assigned to the user, the app will go back to screen1 and the dropdownbox have to be populated with all the licenseplate that are still isactive.Active and Done.NO
my third need is the following: when user select a licenseplate isactive.Active and Done.NO and press a button to navigate to the next screen, the app will then display a list of dropdownboxes and textboxes with questions, some pre-filled for example a textinput "last_maintenance" will have the default value cars.date related to the selected cars.licenseplate (from the dropdownbox in the previous screen), user may change it or not (if changed this will update the sp list field too)
the same for a text box "Last_Maintenance_Km"
I can't find a way to query for cars data related to the user identity and then query for cars data related to the licenseplate.
in powershell probably I would use variables to collect the whole SP lists (if you think about the SPList as csv file for example, or an xml file or a json or whatever with navigable properties ) then use foreach cycles comparing user identity and car.user and then an if statement with the double condition in "and" to check isactive and done, then I will set a varible to proceed or not etc etc but I can't find a way with power app..
I'm sorry if my questions sounds silly but I'm trying filter,distinct and sort without any result since this monday and I was able to perform very few progress.
Thanks for your help