Need help to include calculated column in Data Service / UiPath Apps grid

I am building an app where i am using grid to display the transactions which are stored in Data Service.

Requirement is to have a column in grid named as Ageing which should display the age of the transaction. Formula to be applied is (Today-Created Date). I don’t see an option in data service where i could create a calculated column using this formula. Least I tried to create a formula in UiPath Apps grid as well where I don’t see a solution to put this formula

expectation is to have value automatically either from data service / grid whenever it is loaded or a new row is getting added to data service and displayed in the grid

Kindly help me on this

uipath feedback

@sharazkm32

You can try using custom list for this…where you can display the dataservice and add a nee label to display the difference as well

Cheers

Could you please elaborate more on the solution? What is the formula to be used for identifying the ageing of a record based on its created time

Hello, can you elaborate ?
I will follow this topic because business case from @sharazkm32 is very interesting and I was unable to solve it on my end.

Thanks

@sharazkm32 @Matt67

here is an example

Formula used - DateDiff(DateInterval.Day,ThisRow.CreateTime.Value.LocalDateTime,Now).ToString

Custom list in apps and formula

Dataservice

result

Hope this helps

cheers

2 Likes

Dear @Anil_G,

Appreciate your effort and thank you for your suggestion. This is a good solution provided the platform using is cloud version. For people who are using automation suite- Custom list control is not available as of now (Oct 2024)

I got a work around which I am sharing here for anyone who is looking a solution for similar scenario in Automation Suite

  1. If we are connecting the edit gird directly with the data service - this solution won’t work. Hence create a variable of type ListSource of DataService.
    Example -variable name EntGridSource. Data Service Name = GridSource

  2. On page load - do following events
    Set EntGridSource = GridSource for loading the data to Entity Variable

    Use set variable again for the same variable and use the below expression
    Set EntGridSource = EntSentinelApplicationQueue.data.Select(Function(item) new SentinalApplicationQueue With{.Id = item.Id,.CreateTime = item.CreateTime,.Age = CDec(CInt((Now()-item.CreateTime).Value.TotalHours))}).ToListSource

Use the EntGridSource variable as the source for edit grid instead of directly using Data Service

This way - we can use expressions for for building values in the dummy columns created for calculated fields

3 Likes