This article is using a test data because using customer data is wrong. The rest is very practical stuff. If you don’t use Dataflow for Power Apps still I think you should.
I am trying to solve a typical problem. We’ve got a Choice column Business Type for Account (for example). We need to remove one of the choice items “Re-seller” from the Choice but first we need update all related records using this item.
This is the Choice we use as an example below:
The “Re-seller” has to be removed. We need its value so we look it up to remember.
We also need the Choice item which will be replacing “Re-seller”. In our case it’s “Vendor”.
You will need a Key for Account. I’ve chosen Account Name, in real life you can use Account Number or Code or anything which is unique column for your table in your organisation.
On the maker portal under Data select Dataflow. We will be creating a new one.
We need a Web API query only retrieving Account records with the Business Type we are trying to replace.
So to make it easy we use my favorite tool, https://www.xrmtoolbox.com/plugins/Cinteros.Xrm.FetchXmlBuilder/ If you want to use any other tool or just create it manually you can do it as well.
My query looks like this one below.
In the Dataflow we will use Web API connected to CDS as a datasource.
Copy to URL you constructed in FetchXmlBuilder in the Connection setting.
Sign in with your account.
Follow the steps I described in the article here to get to the stage below:https://wordpress.com/post/msolenacrm.blog/1580
There are only 2 records because it’s a test data. It could be 100002 and it would make a perfect sense then.
Let’s add a conditional column:
Now we can move to mappings. The Destination table will be Account. We only have to map 2 columns: Name and Business Type.
It’s very important to set the Name in the mapping because this field we use for the unique key.
Map Account Business Type to the conditional column we created. Click Next.
This is the result below:
There are no “Re-seller” columns left in the system so after checking any other dependencies you can safely remove it from your Choice field.