Hi friends! I need some assistance with setting variables within my power app. I will try to explain this as briefly as possible...
I am building a multi-screen form app that stakeholders will use to alert my team that an interview needs to be scheduled. Datasource is a Sharepoint site and the app will allow for both submitting new requests and updating existing requests. Here is the first screen of the app:
I'm having no issue with adding new items. The problem I'm running into is when current items need to be updated, and I think it is because of the variables I have set on some of these screens.
Screen section 1 is below with a tree view. The user will only navigate to ScreenSection1 when they are adding a new request:
The user navigates to ScreenSection2 once the Next Screen button is clicked on ScreenSection1, or an item is selected from the gallery on Screen1to edit:
The values are showing up blank when editing a request, presumably because I have no variables set because the user skips over Screen1 when editing an item. So, my question is this - how do I get the form data to show up on this screen for an item that has already been entered and needs to be edited (i.e. it is selected from the gallery on Screen1)?
TIA!
@jessicadduffey nothing wrong with some good old fashioned Rubber Duck Debugging!! Congrats on getting it figured out!
@jrletner ...so I figured this out. This seems to be happening to me a lot lately - I have an issue, I bring it to the power platform community, and once I've talked it through I figure it out. 🙂 I'm using an If(IsBlank) function to check for the variable set when creating a new record, and when it comes back as blank, I am inserting gblCurrentRecord as the alternative. 🙂 Thanks!
@jrletner I think I know what's going on but I'm not sure how to fix it...
When a request for a new record is submitted on ScreenSection1, the information is coming from a different data source (AllOpenRoles). So, all of the highlighted items on ScreenSection are coming from AllOpenRoles, NOT Diversity Reporting List for Power Apps.
How can I tell the app that when someone is editing a request, the item properties need to be from the Global Variable tied to Diversity Reporting List for Power Apps, and if someone is creating a new request, the item properties need to come from AllOpenRoles?
Hi @jrletner - thank you for your response! Sorry that you had issues reading the text on my screenshots. I did set a global variable in the OnSelect property of the gallery (of items submitted already) on Screen 1:
OnSelect:
@jessicadduffey I had issues reading all of the code on the screenshots, so I apologize if I'm misunderstanding your issue completely. I have a suspicion that you're not getting what you want because you're using context variables. A context variable is only available on the page it's declared on (unless you actually pass it through the Navigation function). To test this theory, you could do 1 of 2 things:
1. Pass the context variable through the Navigate function:
2. Change the context variables to global variables using Set:
Set(varName, value)
WarrenBelz
146,658
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional