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 / Retrieve choice column...
Power Apps
Answered

Retrieve choice column value of related dataverse table in model driven form

(1) ShareShare
ReportReport
Posted on by 74

Hi Team

 

I have two dataverse tables A and tables B with many to one relation ship.

 

I have 2 choice columns in table B.I am able to get the text/numeric columns data of related table A.

But i am unable to get the choice column value of related table A in Table B.

I don't want to create an power automate flow to get the choice column.

 

Can anyone help me to retrieve the choice  column value of related table ASAP.

 

 

Appreciate your help in advance

 

Thanks

SG

  • Jonathan Manrique Profile Picture
    2,695 on at

    Hi @SG013 

     

    Yes I understand your approach

    Table A Parent Table B Child

    Through mapping I can obtain the values ​​of a choice from table A in table B and if you use the quick creation form it will be automatically, otherwise you will have to use JS or Power Automate,

    Now vice versa, depending on what you need to do, the thinking may not be correct, because a record from table A can have N records from table B, and every time you add a record from table B it would have to be changed. the choice of table A and that is not what you want. You couldn't do it without code or Power Automate anyway.

     

  • ivan_apps Profile Picture
    2,189 Moderator on at

    Are you trying to map over the choice column from Table A to Table B?  If so, there is a field mapping capability that is available in the classic mode.

    Link here: https://learn.microsoft.com/en-us/power-apps/maker/data-platform/map-entity-fields

     

    If you are trying to simply view but not copy over data from Table A to Table B, you can create a quick view form in Table A and then open your Table B form, and add the Quick View component so that you can see any field from Table A inside of Table B's form.

     

    Hope I understood your request, let me know otherwise.

  • SG013 Profile Picture
    74 on at

    HI @Jmanriquerios @ivan_apps 

     

    I want the Table A choice values in Table B.My requirement is to get the 4 level lookup data i.e Table D.

    One(Table A) to Many(Table B)

    B--> C

    C-->D

    I want the Table A choice column value as other columns data in the Quick view form of Table D.

    I have created calculated columns for text columns till level Table D and able to fetch other columns data except for choice columns. I am unable to get the choice column data using calculated field in the same table or above level Table B.

    I cannot add sub level Quick view forms in Quick view form.

    I have created quick view form in Table B (fetching data of Table A).

    Hope you have understood my concern.

    Please help me to sort out this issue.

    Appreciate your help

     

    Thanks

    SG 

     

  • ivan_apps Profile Picture
    2,189 Moderator on at

    If I understand correctly you want Table A data visible all the way down into Table D. Assuming a 1:N link all the way down A->B->C->D then you will need to cascade the lookup to A into C and D. If you are using Model-Driven apps then you can configure field mappings between the relationships to cascade the lookup down to D. Otherwise you can use Power Automate or classic real-time workflows to ensure the lookup flows down to D. 
    Once in Table D, you should be able to link your Quick view form to view the necessary data.

  • SG013 Profile Picture
    74 on at

    Hi @ivan_apps 

    I want the fields in model driven app forms and views. Please guide me how can i get the data of choice fields value till table D.

     

    Appreciate your help in advance

     

    Many Thanks

    SG

  • Verified answer
    Jonathan Manrique Profile Picture
    2,695 on at

    Hi @SG013 

     

    To achieve this requirement, you must first know that mappings only work when you create the record from a subgrid, associated with the parent table form.

    From there it is very simple, you must go to the old version of solution designer and do the mapping

     

    You look for the relationship and do the mapping

     

    Jmanriquerios_2-1720508153949.png

     

     

     

    Jmanriquerios_0-1720507997889.pngJmanriquerios_1-1720508075309.png

    Jmanriquerios_3-1720508307171.png

     

    Jmanriquerios_4-1720508495115.png

     

     

  • Verified answer
    SG013 Profile Picture
    74 on at

    HI @Jmanriquerios 

     

    Great!. Thanks for your response. Will try it and get back to you.

    In meanwhile i want to get the choice column value in the same table, as i would need to Concatenate the choice column value and Text field value.

    Could you please suggest how can we achieve this?

     

    Appreciate your Quick solution

     

    Many Many Thanks

    SG

     

  • Jonathan Manrique Profile Picture
    2,695 on at

    Hi @SG013 

     

    Using JS,

    Remember to close this conversation thread by accepting the answer or kudos to the people Ivan Apps and Jmanriquerios who have supported you, if you have other questions open another forum

     

    // Ejemplo de cómo llamar a la función obtenerValorOptionSet desde un manejador de eventos del formulario
    function onFormLoad(executionContext) {
     var formContext = executionContext.getFormContext(); // Obtener el contexto del formulario
     obtenerValorOptionSet(formContext); // Llamar a la función y pasar el contexto del formulario
    }
    
    // Función para obtener el valor del Option Set
    function obtenerValorOptionSet(formContext) {
     // Obtener el control del campo Option Set
     var optionSetControl = formContext.getControl("mi_campo_optionset");
    
     // Verificar si el control del campo Option Set existe
     if (optionSetControl) {
     // Obtener el valor del campo Option Set
     var optionSetValue = optionSetControl.getAttribute().getValue();
    
     // Verificar si el campo Option Set tiene un valor seleccionado
     if (optionSetValue != null) {
     console.log("Valor del Option Set: ", optionSetValue);
    
     // Opcional: Obtener el texto de la opción seleccionada
     var optionSetText = optionSetControl.getAttribute().getText();
     console.log("Texto del Option Set: ", optionSetText);
     } else {
     console.log("El campo Option Set no tiene un valor seleccionado.");
     }
     } else {
     console.log("El control del campo Option Set no se encontró en el formulario.");
     }
    }

     

  • Jonathan Manrique Profile Picture
    2,695 on at

    Hi @SG013 

    Hello
    I think you accepted your own answer as a solution and this will not help future powerusers to find solutions to similar situations, check the correct answer

     

     

  • foodiepanda Profile Picture
    5 on at

    @Jmanriquerios 

    I see the script you posted retrieves the values of option set from the current form. But the question is different. The question states to display the lookup fields which are 3-4 level above from parent table.

    In hierarchy of Table A > Table B > Table C > Table D , where A being upper parent and D being lowest child,
    the columns from table A should be displayed in Table D.

    Or if your script achieves the same, could you please elaborate it?
    Thanks in Advance '

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard