web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Choose 3 field from a ...
Power Apps
Unanswered

Choose 3 field from a support table dropdown into my main table

(0) ShareShare
ReportReport
Posted on by 103

Hi, everyone:

 

I have my main table called Detail where the created records are saved. I have also a support table that has Judge name, judgeId, JudgeDescr.  In the form of edit / add  I want the user to choose the name of a judge but I want to save not only the name but the judge's id and JudgeDescr in the main table.

 

I read a lot of blog but almost everything is to show one field and to save another but I want to show the name (Judge Name) in a dropdown but save 3 fields from that support table (Judge) to my main table Detail.

 

Any help I will appreciate it!

 

Veronica

 

 

 

 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Veronica,

    While a Dropdown control only shows one value in its window, it actually contains an entire record and all of the columns in that record can be referenced. You can see what columns are available by selecting the dropdown control and checking the right hand column under Advanced->Value.

    dropdown.PNG

     

    If you have a Patch() statement for saving your data, the syntax would be something like

    Patch(Main,Defaults(Main),{JudgeName: Dropdown1.Selected.JudgeName, 
    JudgeID: Dropdown1.Selected.JudgeID,
    JudgeDescr: Dropdown1.Selected.JudgeDescr})

    The above syntax would add a new row to the Main table from a dropdown control having a table of Judges as its Items property.  

  • Veronica Profile Picture
    103 on at

    Hi Everyone:

     

    I hade to create 3 datacard, two values ( judgeID and Judge descrip) change depending on the judgename.  Labels on this 2 Datacard showing variables varTS and VarNombra.  On the dropdown properties On Select and ON Change I had to code:

     

    Set(varJuez,ddJuezMuni.Selected.Value);
    Set(varTS,ddJuezMuni.Selected.supremecourt_id);
    Set(varNombra,ddJuezMuni.Selected.vNombramiento)

     

    Then I assign the variable to the 

  • Veronica Profile Picture
    103 on at

    Hi Everyone:

     

    I hade to create 3 datacard, two values ( Supremecourt_id and vNombramiento) change depending on the judgename value. Text properties on the Labels of this 2 Datacard showing variables varTS and VarNombra. On the dropdown properties On Select and ON Change of the dropdown from where the user will choose the name I had to code:

     

    Set(varJuez,ddJuezMuni.Selected.Value);

    Set(varTS,ddJuezMuni.Selected.supremecourt_id);

    Set(varNombra,ddJuezMuni.Selected.vNombramiento)

     

    Then I assign the variable to the fields on my Detail table.  

     

    It work but I will try also with Patch.

  • Veronica Profile Picture
    103 on at

    Hi  Drrickryp:

     

    Thank you for the recommendation.  I will try with Patch and let you know.

     

    Regards,

     

    veronica

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Veronica,

    Do you want to save three field values from your Support Table into your Main Table?

    Which type columns do you use to store the Judge name, judgeId, JudgeDescr value?

    Based on the needs that you mentioned, I agree with @Drrickryp's thought almost, I think the Patch function could achieve your needs.

    I assume that you created three separated Single line of text type columns to store the Judge name, judgeId, JudgeDescr value from the Support table in your Main Table.

    I have made a test on my side, please take a try with the following formula:

    Set the Items property of the JudgeDropdown control within your app to following:

    'YourSupportTable'

    Within the right Advanced tab panel, set the Value property to Judge Name column which you want to display within the JudgeDropdown control.

    Set the OnSelect property of the "Submit" button to following:

     

    Patch(
     'YourMainTable',
     Defaults('YourMainTable'),
     {
     JudgeName: JudgeDropdown.Selected.Judgename,
    JudgeId: JudgeDropdown.Selected.judgeId,
    JudgeDescr: JudgeDropdown.Selected.JudgeDescr } )

    Note: The JudgeName, JudgeId and JudgeDescr are all columns in your Main Table. The Judgename, judgeId and JudgeDescr are all columns in your Support table.

    More details about Patch function in PowerApps, please check the following article:

    Patch function

     

    Best regards,

    Kris

     

  • Veronica Profile Picture
    103 on at

    Hi Kris:

     

    First I want to thank you and Drrickryp for take time to answer my questions.  I am the only one learning PowerApps and programming at the same time with some date to comply!!!.  I only have these community to consult my doubts. In this journey I am alone.

     

    Answers:

     

    Do you want to save three field values from your Support Table into your Main Table? - YES.

    Which type columns do you use to store the Judge name (VARCHAR), judgeId(INTEGER), JudgeDescr(VARCHAR) value?

    I will try wth Patch And let you know.

     

    Thanks again,

     

    Veronica

  • Veronica Profile Picture
    103 on at

     I incorporate the changes with the Patch code but it didn't save the info in my main table Detail.  I am sure the problem is that I  tested the code on the On Select property of the dropdown and not on the Summit button.  I have to clean all the other code completly.  I will tested again and let you know.

     

    Thanks,

     

    Veronica

  • Veronica Profile Picture
    103 on at

    Well,

    The status of my work is that I spend all day try to make Patch work and I couldn't. Firts I can't use Defaults because it dulicate records with the Submit form function.  This is my code at the Submit button:

     

    SubmitForm(FormLey148);
    If(Muni = 1,
    Patch('[dbo].[Ley148_2015]',
    Filter('[dbo].[Ley148_2015]', StartsWith(vOfficeLocation,Oficina) && vNumeroOrden=lblNumeroOrden.Text)),
    {
    vJuezInicial:ddJuezMuni2.Selected.vJuezDescripcion,
    vSupremeCourtInicial: ddJuezMuni2.Selected.supremecourt_id,
    vNombramientoInicial: ddJuezMuni2.Selected.vNombramiento
    }
    );
    If(Super = 1,
    Patch('[dbo].[Ley148_2015]',
    Filter('[dbo].[Ley148_2015]', StartsWith(vOfficeLocation,Oficina) && vNumeroOrden=lblNumeroOrden.Text)),
    {
    vJuezInicial:ddJuezSuper2.Selected.vJuezDescripcion,
    vSupremeCourtInicial: ddJuezSuper2.Selected.supremecourt_id,
    vNombramientoInicial: ddJuezSuper2.Selected.vNombramiento
    }
    );
    Navigate(BrowseLey148Screen,ScreenTransition.Cover)

     

    \**

    I have to discriminate between two types if judges Muni or Super thats why the Patch is inside the if condition.  I change the code if ..else.  If and another If.  I think my filter is the problem but I recycle the dilter from a gallery that works.

     

    Any help I will appreciate.

     

    Veronica

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard