Display several variables only if result greater than 1 - slack

Hello, I have a small issue that I can’t seem to resolve. I have a Jotform form that sends me inventory data, and I would like to receive a Slack notification, but only for the data where the result is greater than 1. I also need to display the name of the value, and that name should also be hidden if the value is less than 1.

Example:
Name value = 1
Name value1 = 2
Name value5 = 1

Thank you :pray:

Hi @Alex_Naps,
You could probably use a filter for this. If it’s just one line, then the filter would go before the Slack module.
If there are multiple lines that need to be evaluated then aggregated before being sent to Slack, then you may need an aggregator in conjunction with a filter before your Slack module.

Are you able to share an example of the JSON from the output of the bundle you’re working with? If you have a blueprint that would help too.

2 Likes

The Jotform sends the data that the manager’s wife validates. The Slack notification is intended for me and the laundry service to know which laundry items are arriving for cleaning.

Example:

Duvet cover 220240 = 1
Duvet cover 240
260 = 2
Sheet 140 = 1
Sheet 160 = 3
Small towel = 2
Large towel = 3
etc., etc.

Each result is a field in Jotform; I don’t think the filter is suitable.

Ok, I think if we had the JSON bundle output from the Jotform module, we would be able to provide a more detailed answer for you.
If you can, here’s how to get that:
Go back into run history and select a prior run, click the white bubble that shows up above and to the right of the Jotform module, click the download button to Download the output bundle.
Replace any text that has sensitive information then post the text here.

This will likely require an aggregator with a filter between Jotform and the Aggregator to only allows items to pass when quantity is greater than 0. If it’s an Array aggregator then the result will be an array. If you use a Text Aggregator, then the result would be text. Text would be more appropriate if you’re building a message to send through Slack.

2 Likes

[
{
“action”: “”,
“webhookURL”: “XXXXX”,
“username”: “XXXX”,
“formID”: “XXXX”,
“type”: “WEB”,
“customParams”: “”,
“product”: “”,
“formTitle”: “Cleaning Checklist”,
“customTitle”: “”,
“customTitleParams”: “Array”,
“submissionID”: “XXXX”,
“event”: “”,
“documentID”: “”,
“teamID”: “”,
“subject”: “”,
“deviceIDs”: “Array”,
“isSilent”: “”,
“customBody”: “”,
“customBodyParams”: “Array”,
“trackAction”: “Array”,
“rawRequest”: “{"slug":"submit\/232893300501043","submit_source":"form","jsExecutionTracker":"start-1698616694096->ready-start-1698625508127->validator-called-1698625508200->validator-pre-mount-false-1698625508200->validator-post-mount-true-1698625508200->ready-done-1698625508204->submit-validation-isvalid-1698625510808","submitSource":"submit1698625510773","q7_prestataire":"Alex","q8_selectionnerLe":"","q40_selectionnerLe37":"","q41_selectionnerLe41":"","q42_selectionnerUn":"","q39_roomidBeds24":"","q9_noterLetat":"4","q27_drapsmatelas90":"2","q28_drapsHousses":"","q29_drapsHousses29":"1","q30_drapsHousses30":"","q31_parureLit":"","q32_parureLit32":"","q33_parureLit33":"","q34_parureLit34":"","q35_taieDoreillers":"","q36_torchonCuisine":"","q47_petiteServiette":"","q48_grandeServiette":"","q49_tapisDe":"","q50_autres":"","preview":"true","validatedNewRequiredFieldIDs":"{\"id_7\":\"Al\"}","path":"\/submit\/232893300501043","q14_cuisine":"","q22_salleDe":"","q43_wc":"","q44_salon":"","q45_chambre":"","q46_generale":""}”,
“fromTable”: “”,
“appID”: “”,
“pretty”: “Equipe en charge de la prestation:Alex, Noter l’état de l’appartement ::4, Draps-housses matelas 90:2, Draps housses matelas 160:1”,
“unread”: “”,
“parent”: “”,
“ip”: “XXXX”,
“request”: {
“slug”: “submit/232893300501043”,
“submit_source”: “form”,
“jsExecutionTracker”: “start-1698616694096->ready-start-1698625508127->validator-called-1698625508200->validator-pre-mount-false-1698625508200->validator-post-mount-true-1698625508200->ready-done-1698625508204->submit-validation-isvalid-1698625510808”,
“submitSource”: “xxxx”,
“q7_prestataire”: “Alex”,
“q8_selectionnerLe”: “”,
“q40_selectionnerLe37”: “”,
“q41_selectionnerLe41”: “”,
“q42_selectionnerUn”: “”,
“q39_roomidBeds24”: “”,
“q9_noterLetat”: “4”,
“q27_drapsmatelas90”: “2”,
“q28_drapsHousses”: “”,
“q29_drapsHousses29”: “1”,
“q30_drapsHousses30”: “”,
“q31_parureLit”: “”,
“q32_parureLit32”: “”,
“q33_parureLit33”: “”,
“q34_parureLit34”: “”,
“q35_taieDoreillers”: “”,
“q36_torchonCuisine”: “”,
“q47_petiteServiette”: “”,
“q48_grandeServiette”: “”,
“q49_tapisDe”: “”,
“q50_autres”: “”,
“preview”: “true”,
“validatedNewRequiredFieldIDs”: “{"id_7":"Al"}”,
“path”: “/submit/232893300501043”,
“q14_cuisine”: “”,
“q22_salleDe”: “”,
“q43_wc”: “”,
“q44_salon”: “”,
“q45_chambre”: “”,
“q46_generale”: “”
}
}
]

Thanks for that. Based on that example, I have a couple different kinds of output. Do either of these look like what you want?

If you like this format, it’s a couple functions on the “Pretty” object from the bundle:

If you like this format:
image

There are a couple additional steps involved to get it.

2 Likes

I really like the first result.

There is also this where it only includes the result if it’s greater than 0, which won’t include the one with “Alex”:
image

2 Likes

Please see this blueprint
display-several-variables-only-if-result-greater-than-1-slack-19501.json (8.5 KB)

2 Likes

thank you. I will try to understand how to adapt it to my scenario now

Hello Donald

If I want it to display only part of the information in the Slack text block, how can I do that?

q27_drapsmatelas90”: “2”,
“q28_drapsHousses”: “”,
“q29_drapsHousses29”: “1”,
“q30_drapsHousses30”: “”,
“q31_parureLit”: “”,
“q32_parureLit32”: “”,
“q33_parureLit33”: “”,
“q34_parureLit34”: “”,
“q35_taieDoreillers”: “”,
“q36_torchonCuisine”: “”,
“q47_petiteServiette”: “”,
“q48_grandeServiette”: “”,
“q49_tapisDe”: “”,

I want this part to be intended for the laundry service.

image

Hi Alex,

I’m afraid I don’t understand.
It looks like you’re getting the result you were looking for. Is that correct?

Are you saying the result is still not quite right or are you looking to output a different set of data?

2 Likes