How can I insert an "ADD" button beside Photo attribute?

Hi all,

I want to add an “ADD” button beside the “Photo” entity (screenshot-1) which will be able to take 1 to 7 (multiple) pictures and the pictures will view in the one after another like a Grid view.

How can I do this? Kindly help. (Details in the screenshot)

Thanks

Solved Solved
0 28 1,533
1 ACCEPTED SOLUTION

LeventK
Participant V

Regarding the community members, here is the solution:


STEP-1 :: READ-ONLY SLICE


Summary

A slice is created with READ_ONLY attribute from the Photos Table. Nothing special, no conditional rules, all columns selected. The slice is named as slice_Photos.


STEP-2 :: PRODUCT REVERSE-REF COLUMN


Summary

[Product] ref column in Photos table is set as isPartOf to show this column as a reverse reference in Product_Form


STEP-3 :: VIRTUAL REF COLUMN


Summary

In Product table a ref type Virtual Column is created with below expression. This column is named as Limited Photos.

REF_ROWS("slice_Photos", "Product")


STEP-4 :: SHOW_IF CONDITION


Summary

[Related Photos]

COUNT([Related Photos])<7

[Limited Photos]

COUNT([Related Photos])=7

STEP-5 :: INLINE VIEW


Summary

System generated Photos_Inline UX view has been copied, renamed as slice_Photos_Inline and Data set to slice_Photos


STEP-6 :: PHOTOS FORM


Summary

Photos_Form is set to Auto Save and Auto Re-Open


STEP-7 :: PHOTO VALIDATION*


Summary

A Valid_If condition is set for Photos Table, [Photo] column along with a custom error message to prevent addition of more than 7 photos.:

Valid_If

COUNT([Product].[Related Photos])<7

Invalid Value Error

"Max. 7 photos can be added!"


FINAL RESULT


Summary

Add button is disabled/removed when there’s 7 child records for the parent table

View solution in original post

28 REPLIES 28

LeventK
Participant V

You need to create a reverse reference with the Photos table (if you don’t have such a table, you need to create) and when you’re filling the form in your screenshot, a NEW button will appear (you can change the name to ADD or whatever you like via locale settings) and then limit the number of reference records for the parent table to 7.

Hi,

I have added
COUNT(Product[Related Photos]) <= 7
query under Add (sys-gen of Product table) -> Beheviour -> Only if this condition is true
This isn’t worked.

Then I have this one,
COUNT(
SELECT(
Product[Related Photos],
[Item code] = [_THISROW].[Item code]
)
) <= 7
also not worked Sir.

Is it possible to hide add button after 7 photos added

@abirtanjinadnan
You can use below expression in your child table’s Are updates allowed property. Let’s assume that you want to limit the records by 50:

IF(
COUNT(SELECT(Photos[KeyColumn],TRUE))<=7,"ADDS_AND_UPDATES","UPDATES_ONLY"
)

You may change the allowable status as per your needs. Above is just an example. Provided you don’t want the related photos to be even edited and adds only, you can re-phrase the expression:

IF(
COUNT(SELECT(Photos[KeyColumn],TRUE))<=7,"ADDS_ONLY","READ_ONLY"
)

You can remove any expression under system-gen Add as well and return it to TRUE

Hi,

Sorry! It’s not working. I have added this condition in child table “Photos”. (1st picture)
The add button has gone. But if there are less than 7 photos, it’s also not showing add button. (2nd picture)

3X_d_5_d55dd6b54faa804b840f822aa2254476b2b67eac.png

Remove any editable_if or show_if conditional expression in your Related Column, system generated add button or similar

Sorry.
Still not working.

Actually, I need to hide add button when the related photos limit goes to 7 (picture-1)

)

3X_b_4_b45b2d37a71566c311e8be0a75eae6cc37d4ba0c.png

@abirtanjinadnan
Share your app with levent@able3ventures.com as a co-author and I will handle it.

Yes. I have shared.

Noticed that @abirtanjinadnan. Please do not interact with the app or the editor now.

@abirtanjinadnan
Can you also please give me EDIT ACCESS for your sheet? Thnx.

Maybe, this is edit access option.

3X_a_a_aa88249e727307647270f604dd4bc69b9f75c327.png

Yes. shared

@abirtanjinadnan
Please share the gSheet with Edit access as well.

Yes. gsheet shared

Another thing is that when I select a photo for the Product table’s Photo attribute, the search page is showing all the items. I want only the items of that specific product.

3X_a_d_ad5a4a08b1a71fe7ac0e893426fd5a65199db447.png

@abirtanjinadnan
Mission accomplished…
You can now remove my edit access from the gSheet and the app.

How?
“NEW” is not one of the texts in localize, and neither an action I can find (to display a different name…)
Any tip here?

Hello @abirtanjinadnan
As @LeventK is suggesting. You need to have two tables. One table for the parent entity and another table for the photos child table.
Can you share a screenshot of your tables?

Hi @LeventK and @Eloy_Paredes_Henriqu

Thanks for your suggestions… Actually, my idea was, there is a Product table, where one can add several photos under one product (it can be upside, downside, left of product/ retail box). And photos will be added as related photos, which I have solved from @LeventK 's suggestion. by adding Photos Table.
But I need to select one photo from related photos (virtual column) list which will be added inside Product table as Photo attribute. (which is also solved).

But, when I am adding a Photo in my photo attribute of the Product table, the list is suggesting all photos from Photos table. I want to see only Photos of same labelled (same item code) (screenshot-1)

I am adding my Column/ App screenshots here.

Thanks

3X_a_d_ad5a4a08b1a71fe7ac0e893426fd5a65199db447.png

3X_8_e_8e19a833636ce847b69ef9142de8fb45373ba59a.png 3X_4_1_416f2398d7ef2c59964216dbcb0af6fd913ac75d.png

@abirtanjinadnan
For your [Photo] column of your Producst table, you can use a Valid_if:

SELECT(
    Photos[_ComputedKey],
    [Product] = [_THISROW].[Item Code]
)

Use this tehnique

LeventK
Participant V

Regarding the community members, here is the solution:


STEP-1 :: READ-ONLY SLICE


Summary

A slice is created with READ_ONLY attribute from the Photos Table. Nothing special, no conditional rules, all columns selected. The slice is named as slice_Photos.


STEP-2 :: PRODUCT REVERSE-REF COLUMN


Summary

[Product] ref column in Photos table is set as isPartOf to show this column as a reverse reference in Product_Form


STEP-3 :: VIRTUAL REF COLUMN


Summary

In Product table a ref type Virtual Column is created with below expression. This column is named as Limited Photos.

REF_ROWS("slice_Photos", "Product")


STEP-4 :: SHOW_IF CONDITION


Summary

[Related Photos]

COUNT([Related Photos])<7

[Limited Photos]

COUNT([Related Photos])=7

STEP-5 :: INLINE VIEW


Summary

System generated Photos_Inline UX view has been copied, renamed as slice_Photos_Inline and Data set to slice_Photos


STEP-6 :: PHOTOS FORM


Summary

Photos_Form is set to Auto Save and Auto Re-Open


STEP-7 :: PHOTO VALIDATION*


Summary

A Valid_If condition is set for Photos Table, [Photo] column along with a custom error message to prevent addition of more than 7 photos.:

Valid_If

COUNT([Product].[Related Photos])<7

Invalid Value Error

"Max. 7 photos can be added!"


FINAL RESULT


Summary

Add button is disabled/removed when there’s 7 child records for the parent table

Thank you so much @LeventK

Can I keep the edit and delete permission for photos after 7 pictures added?

3X_e_3_e33044a6d49244c72925634fd6ad16453029b4e9.png 3X_2_a_2a9f9abb24cedd52dffa5089ce61b36230f0823a.png

Yes, definetely you can @abirtanjinadnan

Hi,

Is it possible to hide save/ cancel buttons from this form?

Nope and why you want to remove them?

Good information thanks for sharing
vmware

Top Labels in this Space