Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

How to transfer data from previous screens that are not in dropdown boxes?

Posted on by 72

When beginning the process you select one of the commodity buttons. Each button will take the user to another screen pertaining to the conditioning of the selected commodity.  If yes, is selected how do I transfer the data that has been selected. For example, the commodity would be avocado, with yes being selected dry matter between 23-25 should be conditioned four days. What formula is used for this process?

tchamb2_0-1697736465341.png

tchamb2_1-1697736480124.pngtchamb2_2-1697736502499.png

 

Categories:
  • Verified answer
    Anchov Profile Picture
    Anchov 1,982 on at
    Re: How to transfer data from previous screens that are not in dropdown boxes?

    I'm not sure what the errors are from your screenshot, but you'll need to adapt the example code to your specific situation. For instance, if the commodity dropdown is writing to a lookup field, you'll need to structure the default property as an object . If it's a choice field, the name of the produce should exactly match one of your choices.

     

    As for your next question, the location of the question "Is your dry matter percentage between 23-35%?" depends on your app's layout.

    For example:

    • Screen One: Choose your produce (send context variable to the next screen with Avocado)
    • Screen Two: Choose your dry matter percentage (using context variable display question on dry percentage, on yes / no button, send two context variables over with produce and conditioning days)
      multiple variables can be sent by separating with a coma.
    Navigate('Edit Details Screen', Transition.None, { varCommodity: "Avocado", varConditioningDays: 4})
    • ​Screen Three: Edit the details in a form, set default values based on the variables being sent from the previous screens flow of your app and how it's structured will determine how you pass information from one screen to another.

    Another option, If the variables need to persist in multiple screens, you can also use what called a global variable. Use is similar, but defined using a set command:

    Set(varCommodity, "Avocado");
    Navigate(EditScreen)
  • Verified answer
    CU06111240-0 Profile Picture
    CU06111240-0 72 on at
    Re: How to transfer data from previous screens that are not in dropdown boxes?

    Rick,

     

    Thank you so much for responding! I did the suggested and the default property for the commodity dropdown is not working. Also, how can I use a context variable for the conditioning days on the same screen. For example, conditioning days for dry matter between 23-25 would be four days, 25-27 three days and 27-29 two days. How do I get this information inserted on the form depending on if the question is answered yes or no?

     

    tchamb2_1-1697762876468.png

     

     

  • Anchov Profile Picture
    Anchov 1,982 on at
    Re: How to transfer data from previous screens that are not in dropdown boxes?

     

    For storing this type of information, you can use a variable. In this case, you can send the selected commodity to the next screen using a context variable.

    To achieve this, you would use an OnSelect property for your "Avocado" button like this:

    Navigate('Edit Details Screen', Transition.None, { varCommodity: "Avocado" })

    Then, on the page with your form, in the Default property of your commodity dropdown, you can use the following logic:

    If(!IsBlank(varCommodity), varCommodity, ThisItem.Commodity)

    You would apply similar logic in each of your buttons to change the default commodity type as needed.

    Hope this explanation is helpful!


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers!
    Rick Hurt

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard