I am building my first PowerApp using a SharePoint site and the user would like the "Stage" of the application (Stage_DataCard1, DataCardValue3) to automatically update when other 'triggers' such as "Transferred to Field Date" (DataCardValue17), "Test Completed by" (DataCardValue19) are completed. These fields will be blank (empty) before the data is entered (Date or text).
"DataCardValue3" is a drop down list with items - Choices([@'Log Requests'].Request_x0020_stage)
I need the DataCardValue3 to be either the selected value from the drop down list OR update automatically when one of the trigger points is reached. If a trigger is not met the stage should stay as the last stage.
Is this possible? if so how do I code it? I have had a look online and I think it should be possible but I can't see how - do I use UpdateContext, a plain If statement? Where do I put the code - in DataCardValue3 or where the trigger is entered (DataCardValue17 and DataCardValue19) and under which option?
Solved! Go to Solution.
I am really sorry to re-open this query, but the user has come back with additional requirements, in addition to looking for blank fields - which I now have the coding for (thank you) - they want the Stage updated where an Or statement is needed and also where the fields will not be empty before the data is entered.
The Data cards in question are DataCardValue7 (Choice) and DataCardValue23 (date and time). The choices for DataCardValue7 are 'Select an option', 'CD', ' IRA' and 'EIR'. DataCardValue23 is blank until the date is entered. DataCardValue7 will be completed before DataCardValue23 so the ticket may never reach DataCardValue23 . Should 'Select an Option' or 'CD' be entered or the date entered in to DataCardValue23 the Stage should be changed to 'Complete'.
I have tried to amend your coding to accommodate the new requirements but have been unsuccessful with whatever I try.
What I have done is add the following after 'Value = "Transferred"), ' and before the final ' Parent.Default)) '
Not((DataCardValue7.Selected.Value = "CD"), Lookup(Choices(AB12.Stage), Value = "Completed"),
((DataCardValue7.Selected.Value = "Select an option"), Lookup(Choices(AB12.Stage), Value = "Completed"),
I have tried making this an 'If / Or' statement but nothing is successful - I just get warning messages and the code is underlined in red.
I haven't tried adding DataCardValue23 into the formula yet - I think it sensible to work out how to do DataCardValue7 first.
Can anyone help me with this please?
BTW I am happy to open a new query if necessary.
If I understand your new need here: DataCardValue7 and DataCardValue23 are two new conditions for setting the staging field to Completed:
Is that it ?
Yes that is correct. I thought it would be a straightforward "if(or" statement but - well obviously - I can't work out how to do it.
BTW I am now working on what will hopefully be the production site so I will take your advice on board and label the data card values appropriately before I start the coding.
Ok, so the formula should now be:
If( SharePointForm1.Mode = FormMode.New, LookUp( Choices(AB12.Stage), Value = "New" ), SharePointForm1.Mode = FormMode.View, Parent.Default, SharePointForm1.Mode = FormMode.Edit, If( Not(IsBlank(DataCardValueTestCompletedBy.Text)), LookUp( Choices(AB12.Stage), Value = "Tested" ), Not(IsBlank(DataCardValueTransferredToFieldDate.SelectedDate)), LookUp( Choices(AB12.Stage), Value = "Transferred" ), DataCardValue7.Selected.Value = "Select an option" || DataCardValue7.Selected.Value = "CD" || Not(IsBlank(DataCardValue23.SelectedDate)), LookUp( Choices(AB12.Stage), Value = "Completed" ), Parent.Default ) )
I haven't tested it though...
"...I will take your advice on board and label the data card values appropriately..." 👍👌👏
Thank you for your coding suggestion but I'm afraid that I get error messages - The "function 'If' has some invalid arguments", "Invocation of unknown or unsupported arguments" and "The function 'IsBlank' has some invalid arguments".
It is the ||Not(IsBlank(DataCardValue23.SelectedDate)) which is causing the error - when I blank it out that section of the coding I get no error warnings however the value does not update to "Complete" when it should. I have attached a screen grabs of both sets of coding (with and without blocked out coding).
Check out the News & Announcements to learn more.
Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.