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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dataverse column as a ...
Power Apps
Unanswered

Dataverse column as a choice of 2 other column values from the same table

(0) ShareShare
ReportReport
Posted on by 20

 I am trying to build a Model-drive Application and trying to identify the best way to tackle the below problem.

 

I have a table with location columns - initial location, customer location and current location. The current location can be one of the following:

  1. Initial location
  2. Customer's location
  3. Empty (meaning it is at customer's location)

 

Initial Location - can never be empty

Customer Location - can be empty as the item is still at the initial location.

 

Now, I would like the current location choice to only display three possible values - initial location, customer's location, N/A.

 

How can I achieve this? Because, the values are going to be dynamic and can only be really shown once the Initial Location and Customer Location has values.

Is there a better way to approach this problem? Like, at the form level instead of trying to achieve this at the Dataverse level?

 

If I have to do it at the form level, how can I do this?

I have the same question (0)
  • Jonathan Manrique Profile Picture
    2,687 on at

    Hi @SajidSalim 

     

    To address this challenge you can do it in several ways but I recommend at the backend level because of the result you expect.

    First in the frontend it is through JS to perhaps make a switch and depending on the combination of values the value of the current location is completed. You should do this JS in the initial location onchange, client location, remove current location values and only show those three that you mention, something you should see is that if it is an option set change, the ideal is that they are the same values and perhaps for current location add N/A.

     

    I give you an example code of how to hide the value of option set, you must do this dynamically because you will have to hide all the values and only leave three values

     

    function ocultarOpcion(executionContext) {
     var formContext = executionContext.getFormContext();
     var pickList = formContext.getControl("nombre_del_conjunto_de_opciones");
     
     // Elimina la opción con valor 1
     pickList.removeOption(1);
     
     // Elimina la opción con valor 2
     pickList.removeOption(2);
     
     // Puedes seguir eliminando más opciones según tus necesidades
    }
    

     

     

  • Shashank Bhide Profile Picture
    942 Moderator on at

    You can perhaps create a PCF control doing that, but I guess whichever route you take this will require JS customization work.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard