cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Audreyma
Helper II
Helper II

Is it possible to use Entity List and Fetch xml at the same time?

Hi everyone,

I'm a fresher for power apps portal.

 

Recently I create a customer portal to record some config info of clients' env.

There I had a need to merge 3 columns' value into another 1 column.

Since the data type of original columns is Option Set, I was told that the merge can only be realized by Fetchxml.

Actually I have no experience in Code-writing.  Thus, getting all the data and customizing some button etc. via Fetchxml will be quite difficult for me.

 

In addition,  the target columns that I want to merge is only 3 columns.

I doubt if I can design the main layout through Entity list, and merge the target columns by adding Fetchxml at the same time.

Any ideas about it,  please kindly share with me.

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Fubar
Solution Sage
Solution Sage

  • In the workflow, set the Scope or Organization  (generally this is what you use most - user = workflow will only run on records owned by the user executing the workflow).
  • For your scenario, would anticipate you only have Create and Change ticked (and inside the Change, the 3 fields ticked - there should be a view link next to the fields change tickbox where you can tick the individual fields) 
  • Set Start when: After, After 

Also, as it is a workflow you can change it from realtime to background when ever you want (button in the command bar).  By default the realtime workflow will record when there was a failure (on the portal if a realtime workflow fails you will get an error shown to the Portal user), with a background workflow you can tick/untick the box to retain the session for both successful and failures - this can help when it looks like it didn't run as the session will tell you it did (sessions are on the right hand column)

 

My previous comment was about a) the bit I struck out in the post, b) that in Flow, optionsets are an object (referenced by their Value/index not the label you see in the dropdown), to get what you see in the drop down (i.e. what you want to concat) you need to reference the field in a special way as it is its label that you are concatenating.

 

 

View solution in original post

Audreyma
Helper II
Helper II

Hi @Fubar  @OliverRodrigues ,

Good news, I made it just now!

Hour,minute and second are merged successfully. 

Actually there is no need to use Concat formula.

In the column which I use to save merged results, I select the 3 columns from Form assistant  and connect them directly with ":".

It works normally whenever I create a new record or update a current record.

{From_Hour(entityname)}:{From_Minute(entityname)}:{From_Second(entityname)} 

 

Thank you so much for all your help regarding this question!

 

View solution in original post

19 REPLIES 19
OliverRodrigues
Super User II
Super User II

Hi, if you want a code free solution you can take a look at calculated fields:

https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/define-calcula...

 

I am assuming your fields are from the same table/entity. You can create a new field and set the type as calculated, then set the calculation formula using CONCAT option, this should be very similar to an excel formula. And finally you can reference this new field instead of the 3 fields in your entity list/view.

 

There is no way to "merge" the fields via fetch, I am not sure exactly what you were told. Via code you would have a few other options:

  • Manipulate via JS the entity list, merging the columns into a single one
  • Render the entity list via Liquid, merging the columns you want while rendering
  • Not use entity list and do a complete render via Liquid/FetchXML, again merging the columns you want



If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

@OliverRodrigues 

Hi Oliver,

Thank you for your reply.

I'm afraid CONCAT doesn't work for my situation.  

I did try it, but the data type of the original columns is Option Set, they can't be attained via Concat.

※CONCAT seems work for text or datetime, not for Option set.

 

I'm quite interested in what you mentioned below.

Here via code, it's not via fetch xml, but via editing Liquid code?

Could you kindly share with more details or some examples about it?  Thanks in advance!

Via code you would have a few other options:

  • Manipulate via JS the entity list, merging the columns into a single one
  • Render the entity list via Liquid, merging the columns you want while rendering

 

Fubar
Solution Sage
Solution Sage

What do you need to merge, why, and when? Often you use a realtime workflow?

Hi @Fubar 

I have 3 columns, which represent Hour,Minute, and Second. 

 

I'm now setting their data type as "Option Set", so that in entity form, the end-users can directly select the time number instead of input manually.

After the users finish the form, the info input will be displayed in an entity list.

There, instead of displaying time separately, I hope to merge the 3 columns into 1 column ad HH:MM:SS.

Audreyma_0-1615180333747.png

 

 

 

 

 

Fubar
Solution Sage
Solution Sage

So several options:

  • Enity Form: add a field to hold the concatenated value, and concatenate with JavaScript prior to form submission (either onChange of the values or in the form validation - you can add to the out of the box validations - https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/add-custom-javascript.  Note in the dataverse form definition the field needs to be set as visible and editable (you can hide or make it readonly with CSS / JQuery on the portal)
  • Realtime workflow (or plugin): add a field to hold the concated value, then use realtime workflow to concatenate (set the trigger on create and also on update of the 3 fields) - note must be realtime so the value will refresh in the list view.

 

OliverRodrigues
Super User II
Super User II

If CONCAT can't do the job, try a real-time workflow as suggested bu @Fubar 

https://docs.microsoft.com/en-us/powerapps/maker/data-platform/overview-realtime-workflows

 

that's probably the easiest and simplest way to achieve it 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

OliverRodrigues
Super User II
Super User II

Also, I don't want to interfere in your data model, but option set for Hour/Minute/Second, is there a reason for that? shouldn't you be looking at Datetime fields? 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Hi @OliverRodrigues 

About creating real-time flow, it seems that I can't find the option "Run this workflow in the background" in Power Automate.

Is it something that will appear when flow is created successfully?  Because now there is an error which made flow-creation fail.

About data type, I know it can be set Datetime.  But Date time can only enable users to select from day to minutes, not to seconds.

Do you know if there is any method to make datetime input extend to seconds?  

OliverRodrigues
Super User II
Super User II

The real-time workflow is for classic Dataverse/D365 workflows, those aren't applicable for Power Automate Flows. So in this case you would have to create as a classic Workflow. If you don't mind it being Async/having the 15 min cache SLA you can still use Power Automate Flow.

 

Maybe just to explain better.. if you are populating the data via workflow/flow that is triggered via Portal (for example after create or update of a record), you probably want that data to be reflected in the Portal immediately, so in that case you would need a real-time/classic workflow.

If those fields are populated in another transaction (not triggered via Portal), it doesn't really matter if you are using Power Automate / classic Workflows / Real-Time or Async. You can use whatever you are most comfortable with (probably Power Automate Flow). 

 

Finally with regards to the datatype, yes you are right, by default the seconds aren't displayed, however I am nearly sure if you just change the way the date control is rendered, you will be able to save the seconds.

Is that an Entity Form that you intent to populate the field? 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (81,985)