cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hetvik
Helper I
Helper I

Set the value of lookup field to other single line of text field

Hi

In my table (dataverse) I have a lookup field and I would like to set a business rule to set the value of other field(single line of text) to the value of lookup field selected.

1 ACCEPTED SOLUTION

Accepted Solutions
EricRegnier
Super User
Super User

Hi @Hetvik,

Not sure if this is resolved yet, but another option is with calculated columns/fields which would also avoid customizations with code (e,g. JavaScript) if you need real-time/sync. 

Cheers!

View solution in original post

10 REPLIES 10
ChrisPiasecki
Super User
Super User

Hi @Hetvik,

 

Unfortunately this is not possible using a business rule because the data types do not match up (you can set a text field using another text field value, etc.). If you need to see the text value set immediately upon setting the lookup in the user interface, then you will need to use JavaScript to achieve this. If it doesn't need to be immediately but can be on save, then you can use a classic Dataverse synchronous workflow to achieve this.

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

dpoggemann
Super User
Super User

Hi @Hetvik,

This is not possible with a business rule in Power Apps. 

Some options:

1.  Custom JavaScript or Plugin

2.  Power Automate flow - Although this would be asychronous...

 

Hope this helps.  Please mark accepted or Like if provides some value.

 

Thanks,


Drew

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew

Hi @ChrisPiasecki,

 

I was replying about the same time as you and testing out the real-time workflow.  I was not able to accomplish this with a real-time classic workflow, were you able to make this work?

 

Thanks,

Drew 

Hope this helps. Please accept if answers your question or Like if helps in any way.
Thanks,
Drew
ChrisPiasecki
Super User
Super User

Hi @dpoggemann,

 

You're right in that the workflow will only get the lookup fields primary field text, not the GUID of the record.

A custom workflow activity, plugin, or Power Automate Flow are options in addition to JavaScript as mentioned.

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

Fubar
Solution Sage
Solution Sage

@ChrisPiaseckithink all that is being asked by the original poste is for it to copy the 'name' from the Lookup to a Text field and not the guid or other fields off the lookup record - and as such Real-time workflow is probably the way to go. 

@Fubar yes my original response was based on that assumption as well but after re-reading the original post I feel it could be interpreted as the value (guid) of the Lookup too. We'll see what @Hetvik responds back with. 

EricRegnier
Super User
Super User

Hi @Hetvik,

Not sure if this is resolved yet, but another option is with calculated columns/fields which would also avoid customizations with code (e,g. JavaScript) if you need real-time/sync. 

Cheers!

Hi @EricRegnier ,
I tried with calculated columns, they work. However, the text field is only updated when I save the form. I wanted the field to be immediately updated, as soon as I change the lookup value. A part the option of auto saving the form in JS, can we do anything else?

Many thanks

Bruno

Hi @brunex01, for calculated columns, unfortunately it would only only after saved because calculated columns are caclulated ar runtime when the record is retrieved (values are not stored in the database). JS would be your only option for now with an onchange handler. Maybe eventually when PowerFX calculated columns are released it may be possible, but something to try out them.

Hope this helps!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,511)