Large Binary Data Entities
Application Type
Mobile

Good afternoon, our app allows field inspectors to take photos, scan documents or generate report at a site and then produce a PDF with two photos per page and some descriptions under each.  The home screen/Project Sceen is a list-group of all the projects the user has created and either has or will go take photos of.  

What I'm trying to do:

In short, if user has visited the site and took his photos, we need a photo (the first photo taken) to show within the project list on that home screen/project screen. Below is an example of the project screen and the photo displayed is the first photo within the Photo entity for that ProjectId (one to many relationship, one project to many photos).  

With the understanding I have a screen displaying in a list group the Projects entity how could I have an image within that list display the first photo taken of all the photos in the photo entity for that project?  If anyone knows any insight or has ideas that could help, I would greatly appreciate it.  

What I'm trying to avoid:

 I'm concerned with the project screen seeing delays in calling that entity to retrieve the first photo of the group of photos taken under that projectid. How can I call the first picture of that ProjectId's > Photos for the picture.   


mvp_badge
MVP
Solution

Hi Cody,

For the mentioned use case, I would suggest you consider the project ListItem - Image section to be a Block element i.e. 

  • Define a Block that does have an input parameter called ProjectId
  • Within the Block, you would have an Aggregate called GetProjectPhotoByProjectId
  • The aggregate GetProjectPhotoByProjectId will have a Filter condition ProjectPhoto.ProjectId = ProjectId (input parameter) and also Sorting ProjectPhoto.CreatedOn Ascending
  • Set the GetProjectPhotoByProjectId aggregate Max. Records property value to 1
  • And also, Include an Image widget within the Block, which will be mapped with the GetProjectPhotoByProjectId Aggregate result set attribute value called ProjectPhoto.BinaryContent


I hope this helps you!


Kind regards,

Benjith Sam

Thank you for your help on this! It was VERY much appreciated. : )

mvp_badge
MVP

You're most welcome, Cody.

Glad to help you :)


Kind regards,

Benjith Sam

You there? 

Do you mind if I ask you a quick question just to see if you might know and cut a little time off the trial and error invested in this speedbump so far? LOL - if not that is ok of course.

I need to use an API to call data on an insurance claim by the FileNumber.  The API oParms only let me call 1 claim at a time; by manually typing in the FileNumber to the oParms and running it. I have 20,000+ claims to call.  So I put all 20,000+ FileNumbers into an entity and trying to create an Action Flow where when it is ran (using a timer) it will pull the first FileNumber from that entity, input it into a variable, then GetAPI Data, retire that called data to an entity, go to the next row in the FileNumber entity, send that over to the variable, run the API again for that file number, retire data to entity, so on, so on and so on, till all 20,000 claims data has been pulled and moved over to the entity.

Below is the screen shots of where I am at so far via trial and error to get this to work.  First screen shot is the API oParms screen with the variable put in  for the "FileTracFileNumber":

Then this second screen shot below is of the Action Flow I'm working with or where I have it at present:


Longer explanation if it helps to know what is going on here:

I'm consuming an API which outputs a bunch of details regarding an insurance claim as an array with approximately 40+ structures - 80 structures in an array.  This is then taken and added to various attributes under an entity within my Outsystems App.  There is no problem here; however, the the consuming parameters for this SOAP API (FileNumber) only allow me to call one claims data at a time.  There is approximately 20,000 claims I need to call data for.  Once I have called it all and have it in my entities, I would only need to update claims as they are changed moving forward which I have taken care of.  

See above first screen shot, where the highlighted parameter (FileNumber) is the one I am using to call the claim data because I do have an entity already with all 20,000+ FileNumbers.  If I put one FileNumber in the below parameter it will consume the data and input into my entity correctly.  So what I was thinking is if I could create an action flow that GetsFileNumber from my entity (one row at a time) > and then assigns it to a output variable.  Then under the API Parameters, use the output variable that is now storing the FileNumber on the first row instead of typing the FileNumber into the field.  This is where I'm at presently and that Variable is what you see highlighted in that screen shot of the parameters fields for this API. The part I'm getting stuck on I think is being able to move to the next row within the entity and move that next file number over to the API oParms.  Maybe I need to use the FileNumber.CurrentRow +1 expression here somewhere instead of the "ForEach" action?

t a way to fill that Parameter 

FYI- just sent you a message to regarding an opportunity... sorry it is so long winded : )  Wanted to make sure you had all the details so you could look anything up or do research if you needed to in order to make a decision.  Thanks for the consideration I'm proposing via that message. : )

Got it to work... Holy crap it was the simplest thing ever! I keep overcomplicating things to say the least. Blah! lol  See I mean someone that knew Outsystems, I would think could get things done in just no time flat.  I'm telling you, let's partner up.  Work on the development with me and I will get make it viral in my industry the moment you are done! lol

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.