Error when trying to retrieve data from the network – Power Apps/ Dataverse


Recently in one of the custom pages (canvas app), we started getting the below error “Error when trying to retrieve data from the network” and no data was being retrieved.

Decreasing the data row limit to 500 from 2000 seemed to fix this issue for us.

I assume it could be because of the number of records increasing in the environment over time causing this issue.

Interestingly after a few days when we tried to check the root cause of the issue, by increasing the row limit back to 2000, we weren’t getting that error anymore.

Articles to refer –

https://thepoweraddict.com/how-to-fix-error-when-trying-to-retrieve-data-from-the-network/

https://powerusers.microsoft.com/t5/Building-Power-Apps/quot-Error-when-trying-to-retrieve-data-from-the-network-quot-on/td-p/1452970#:~:text=This%20may%20be%20a%20temporary,connection%20to%20test%20it%20again.

https://sharepains.com/2022/07/04/error-when-trying-to-retrieve-data-from-the-network/

Hope it helps..

 

Advertisements

Applying filter on Multi Choices / Multi-Select OptionSet – Power Apps / Dataverse


Say for e.g. we have 2 multi-select choice columns in our leads table, one is local (My Local Multi Choice Field) and the other field ((My Local Global Multi Choice Field) refers to the global option set field

In our Canvas App, to filter on ‘My Local Multi Choice Field’ by value Local Choice 2 and Local Choice 3, we can apply the below formula.

Similarly, for the Global option set to apply a filter on the Global Choice 2 value, we can compare the field in the lead with the values in the Global Option set.

As we are using “in” operator, we’d get the delegation warning. And for it to work in the case of combo box we would have to set “Allow Searching” to “Off

Hope it helps..

Advertisements

Using Coalesce Function to handle null value in Power Automate – Dataverse


Recently in one of our flows, we were getting the below error –

InvalidTemplate. Unable to process template language expressions in action ‘List_rows_:_Region’ inputs at line ‘0’ and column ‘0’: ‘The template language function ‘replace’ expects its first parameter ‘string’ to be a string. The provided value is of type ‘Null’. Please see https://aka.ms/logicexpressions#replace for usage details.’.

One or more fields provided is of type ‘Null’, a different type is expected.

This was because the replace function that we were using for the Filter rows property of List Rows (Dataverse) had the variable value as null.

Below was our dynamics expression where we replaced apostrophe with 2 single quotes – https://nishantrana.me/2023/02/27/how-to-handle-single-quote-apostrophe-in-filter-rows-in-power-automate-dataverse/

replace(replace(variables(‘varFieldData’)?[‘myVariable’],‘_’,’ ‘),””,”””)

The solution was to use coalesce function, to replace null with a blank string as shown below.

replace(replace(coalesce(variables(‘varFieldData’)?[‘myVariable’],”),‘_’,’ ‘),””,”””)

Similarly, we can use coalesce function to provide a default value.

The coalesce function will evaluate its arguments in order and will return the first non-blank or non-empty value. If all the arguments are blank or empty strings, the function will return blank.

After using the coalesce function, our flow was successful.

More on COALESCE

A similar example in SQL –

Hope it helps..

Advertisements

Binding Choice / OptionSet (multiselect) with Combo box in Canvas Apps / Power Apps (DataVerse)


Instead of hardcoding Combo box , we can bind it to the Choice / Option Set field of Dynamics 365 / Dataverse.

Format – Choices(DataSource[@columnname])

Check out the post that explains it – https://debajmecrm.com/how-to-bind-a-multiselect-choice-of-dataverse-to-a-combobox-in-canvas-apps/

Also check out – how to bind and do filter on multiselect combo box – https://youtu.be/5dSk5iOgT68?t=286

To learn about all the properties of Combo box refer – https://www.spguides.com/powerapps-combobox-control/

Hope it helps..

Advertisements