Forum Discussion

akash0800's avatar
akash0800
Helper I
3 years ago
Solved

Dynamic powerapp

Hi,

 

I am new to powerapps and want to explore the possibility of building a powerapp form that can act in a dynamic way.

 

For example:

My data is coming from SharePoint list

Emp id, Emp Name - single line text columns Design, Deployment - drop-down list

Now I want to build a review form on top of this data for each year and store it back to my SharePoint list.

 

Query: While creating the form from my existing data the data cards are automatically picked evaluated and the data is written back with no other issues.

But when I have to capture data for next year, I again need to perform some basic configuration to include the new field values.

 

I need your help to know the way out from this situation.

 

Note: I also tried to build a form from scratch and try bind the data, but it failed when trying to add data for next year.

In this form I had an additional label that captures the year and other field names keep changing based on the value.

 

Thanks,

Akash 

  • Hello akash0800,

     

    You can dynamically change the fields in the form based on the selected year by using the PowerApps formula language. Here are the steps to accomplish this:

  • Sahir_Maharaj's avatar
    Sahir_Maharaj
    3 years ago

    1. Create a drop-down control to select the year in the form.

  • Sahir_Maharaj's avatar
    Sahir_Maharaj
    3 years ago

    2. Create a data card for each field you want to display in the form and set their visibility based on the selected year.

  • Sahir_Maharaj's avatar
    Sahir_Maharaj
    3 years ago

    5. Use the context variable in the "Default" property of the data cards to display the appropriate data for the selected year. For example: LookUp(SharePointList, EmpID = Form1.LastSubmit.EmpID, SelectedYear)

  • Sahir_Maharaj's avatar
    Sahir_Maharaj
    3 years ago

    By using these steps, you can dynamically change the fields in the form based on the selected year, without having to create a separate form for each year.

  • You can also store the data for each year in a separate row in the SharePoint list, using the "EmpID" and "Year" columns as a composite key.

9 Replies

  • Hello akash0800,

     

    You can dynamically change the fields in the form based on the selected year by using the PowerApps formula language. Here are the steps to accomplish this:

    • Sahir_Maharaj's avatar
      Sahir_Maharaj
      Super User

      By using these steps, you can dynamically change the fields in the form based on the selected year, without having to create a separate form for each year.

    • Sahir_Maharaj's avatar
      Sahir_Maharaj
      Super User

      1. Create a drop-down control to select the year in the form.

    • Sahir_Maharaj's avatar
      Sahir_Maharaj
      Super User

      2. Create a data card for each field you want to display in the form and set their visibility based on the selected year.

  • You can also store the data for each year in a separate row in the SharePoint list, using the "EmpID" and "Year" columns as a composite key.