Formula for Collections

Hey again Makers, I have one last inquiry that I don’t thing has been acknowledged by the community ‘How to questions and answers’ yet.

My issue is I’m trying to break down collections into bundles using an iterator but for 3 different ‘collection’ components. My goal is to get a formula that maps out the correct ‘collection’ component that will consistently output “x” outputs. And, map out the correct variable (for example, “question”) Please see the video here for a clearer explanation:

https://share.descript.com/view/WOEBixgSK6m

Could you share your scenario blueprint so it will be easier to see what sort of data you are working with? Or at least the Parse JSON input structure so we can play around with the sort of data you are dealing with.

Certainly! Will produce a short clip for that right now.

Please see the contents I’m working with in this clip :slight_smile:

That’s great but if you could copy and paste your ChatGPT output bundles that I could use for a start. Do you know where the output bundles can be copied and pasted? It’s sort of hidden in the UI…

image

I see what you mean by copying the transcript – I think this is a limitation of the Vimeo player. I know I can download the transcripts of each video but for now I think I’ll keep that to myself, those videos probably need a good edit and I don’t know if the transcript is accurate anyways (it’s machine-generated by Vimeo and I didn’t edit them at all).

1 Like

Gotcha! I’ve clicked the ‘Download output bundles’ and this is what it outputs (below):

“[
{
“result”: “{\n "ThesisStatement": "ProResults Plumbing is dedicated to providing top-notch plumbing services, including 24/7 emergency support, residential and commercial plumbing, and specialized services like Kitec replacement, throughout the Greater Toronto Area. With a commitment to transparent pricing and exceptional customer care, they aim to raise the standard of local plumbing companies.",\n "CoreOfferings": [\n "24/7 Emergency Service: Provide immediate assistance for plumbing emergencies, ensuring quick resolution to urgent issues.",\n "Residential Plumbing: Offer comprehensive plumbing services for homeowners, including maintenance, repairs, and renovations.",\n "Commercial Plumbing: Deliver specialized plumbing solutions tailored for businesses, ensuring minimal disruption to operations.",\n "New Construction Plumbing: Handle all plumbing needs for new builds, from underground plumbing to fixture installation.",\n "Kitec Replacement: Expertly remove and replace Kitec plumbing systems to prevent costly damages.",\n "Drain Services: Provide drain cleaning, unclogging, and sewer repair services to ensure proper drainage."\n ],\n "BusinessCategory": [\n "Plumbing Services",\n "Emergency Plumbing",\n "Residential and Commercial Plumbing"\n ],\n "FAQs": [\n {\n "question": "What types of plumbing services do you offer?",\n "answer": "We offer a wide range of plumbing services including emergency plumbing, residential and commercial plumbing, new construction plumbing, Kitec replacement, and drain services."\n },\n {\n "question": "Are your plumbers licensed and insured?",\n "answer": "Yes, all our plumbers are fully licensed and insured, ensuring that your plumbing needs are handled by qualified professionals."\n },\n {\n "question": "How quickly can you respond to a plumbing emergency?",\n "answer": "We provide 24/7 emergency plumbing services and can typically respond within the hour, depending on your location."\n },\n {\n "question": "What is Kitec plumbing and why should I replace it?",\n "answer": "Kitec plumbing is a type of piping that has been known to fail, leading to water damage. We specialize in its removal and replacement to prevent costly repairs."\n },\n {\n "question": "Do you provide free estimates for plumbing services?",\n "answer": "Yes, we offer free estimates for all our plumbing services, including new construction projects."\n }\n ],\n "TargetAudience": [\n {\n "segment": "Homeowners",\n "characteristics": "Individuals or families living in residential properties, often seeking reliable plumbing services for maintenance and emergencies.",\n "needs": "Dependable plumbing solutions, quick response times for emergencies, and transparent pricing."\n },\n {\n "segment": "Business Owners/Property Managers",\n "characteristics": "Professionals managing commercial properties or businesses that require ongoing plumbing maintenance and emergency services.",\n "needs": "Efficient plumbing solutions that minimize downtime, reliable service for multiple properties, and expertise in commercial plumbing."\n }\n ],\n "PrimaryAvatars": [\n {\n "name": "Emily Carter",\n "demographics": "35 years old, married with one child, homeowner in Oakville",\n "psychographics": "Values family comfort and safety, prefers reliable and quick service, concerned about home maintenance costs.",\n "painPoints": "Experiences frequent plumbing issues, needs trustworthy service providers, and is worried about unexpected repair costs."\n },\n {\n "name": "David Smith",\n "demographics": "42 years old, Facility Manager for a commercial property in Burlington",\n "psychographics": "Focuses on operational efficiency, values timely service, and seeks cost-effective solutions for plumbing needs.",\n "painPoints": "Requires immediate response for plumbing emergencies, needs to ensure tenant satisfaction, and faces budget constraints for maintenance."\n }\n ]\n}”,
“id”: “chatcmpl-9zRZ5S34jAyYYYAG7y98nc8e3tXPw”,
“object”: “chat.completion”,
“created”: “2024-08-23T16:36:35.000Z”,
“model”: “gpt-4o-mini-2024-07-18”,
“choices”: [
{
“index”: 0,
“message”: {
“role”: “assistant”,
“content”: “{\n "ThesisStatement": "ProResults Plumbing is dedicated to providing top-notch plumbing services, including 24/7 emergency support, residential and commercial plumbing, and specialized services like Kitec replacement, throughout the Greater Toronto Area. With a commitment to transparent pricing and exceptional customer care, they aim to raise the standard of local plumbing companies.",\n "CoreOfferings": [\n "24/7 Emergency Service: Provide immediate assistance for plumbing emergencies, ensuring quick resolution to urgent issues.",\n "Residential Plumbing: Offer comprehensive plumbing services for homeowners, including maintenance, repairs, and renovations.",\n "Commercial Plumbing: Deliver specialized plumbing solutions tailored for businesses, ensuring minimal disruption to operations.",\n "New Construction Plumbing: Handle all plumbing needs for new builds, from underground plumbing to fixture installation.",\n "Kitec Replacement: Expertly remove and replace Kitec plumbing systems to prevent costly damages.",\n "Drain Services: Provide drain cleaning, unclogging, and sewer repair services to ensure proper drainage."\n ],\n "BusinessCategory": [\n "Plumbing Services",\n "Emergency Plumbing",\n "Residential and Commercial Plumbing"\n ],\n "FAQs": [\n {\n "question": "What types of plumbing services do you offer?",\n "answer": "We offer a wide range of plumbing services including emergency plumbing, residential and commercial plumbing, new construction plumbing, Kitec replacement, and drain services."\n },\n {\n "question": "Are your plumbers licensed and insured?",\n "answer": "Yes, all our plumbers are fully licensed and insured, ensuring that your plumbing needs are handled by qualified professionals."\n },\n {\n "question": "How quickly can you respond to a plumbing emergency?",\n "answer": "We provide 24/7 emergency plumbing services and can typically respond within the hour, depending on your location."\n },\n {\n "question": "What is Kitec plumbing and why should I replace it?",\n "answer": "Kitec plumbing is a type of piping that has been known to fail, leading to water damage. We specialize in its removal and replacement to prevent costly repairs."\n },\n {\n "question": "Do you provide free estimates for plumbing services?",\n "answer": "Yes, we offer free estimates for all our plumbing services, including new construction projects."\n }\n ],\n "TargetAudience": [\n {\n "segment": "Homeowners",\n "characteristics": "Individuals or families living in residential properties, often seeking reliable plumbing services for maintenance and emergencies.",\n "needs": "Dependable plumbing solutions, quick response times for emergencies, and transparent pricing."\n },\n {\n "segment": "Business Owners/Property Managers",\n "characteristics": "Professionals managing commercial properties or businesses that require ongoing plumbing maintenance and emergency services.",\n "needs": "Efficient plumbing solutions that minimize downtime, reliable service for multiple properties, and expertise in commercial plumbing."\n }\n ],\n "PrimaryAvatars": [\n {\n "name": "Emily Carter",\n "demographics": "35 years old, married with one child, homeowner in Oakville",\n "psychographics": "Values family comfort and safety, prefers reliable and quick service, concerned about home maintenance costs.",\n "painPoints": "Experiences frequent plumbing issues, needs trustworthy service providers, and is worried about unexpected repair costs."\n },\n {\n "name": "David Smith",\n "demographics": "42 years old, Facility Manager for a commercial property in Burlington",\n "psychographics": "Focuses on operational efficiency, values timely service, and seeks cost-effective solutions for plumbing needs.",\n "painPoints": "Requires immediate response for plumbing emergencies, needs to ensure tenant satisfaction, and faces budget constraints for maintenance."\n }\n ]\n}”,
“refusal”: null
},
“logprobs”: null,
“finish_reason”: “stop”
}
],
“usage”: {
“prompt_tokens”: 6854,
“completion_tokens”: 776,
“total_tokens”: 7630
},
“system_fingerprint”: “fp_507c9469a1”
}
]”

No worries at all! If they ever become available, great. Otherwise, the video is extremely valuable - bookmarked it for future reference regardless!

There are 9 videos – all build on top of each other in terms of videos. LOTS more to learn after the first one.

1 Like

Could you format the JSON with the code formatting tool in Discourse (it’s the </> icon) In the editing toolbar, please?

Thank you so much Alex. This weekend will be fun

1 Like

Never used Discourse but I just created an account. Will have the JSON code formatted when I find the formatting tool and post here. Thanks for your patience!

This forum runs on discourse. The code formatter is right here:

the JSON output you pasted has curly quotes and that is a big no-no.

Omg…thank you Alex. That was painful hahaha. I’ve pasted the output code from Make onto the code formatter and the outcome is below. Please note, I’m also happy to share access to my workflow if it helps you!

[
{
“result”: “{\n "ThesisStatement": "ProResults Plumbing is dedicated to providing top-notch plumbing services, including 24/7 emergency support, residential and commercial plumbing, and specialized services like Kitec replacement, throughout the Greater Toronto Area. With a commitment to transparent pricing and exceptional customer care, they aim to raise the standard of local plumbing companies.",\n "CoreOfferings": [\n "24/7 Emergency Service: Provide immediate assistance for plumbing emergencies, ensuring quick resolution to urgent issues.",\n "Residential Plumbing: Offer comprehensive plumbing services for homeowners, including maintenance, repairs, and renovations.",\n "Commercial Plumbing: Deliver specialized plumbing solutions tailored for businesses, ensuring minimal disruption to operations.",\n "New Construction Plumbing: Handle all plumbing needs for new builds, from underground plumbing to fixture installation.",\n "Kitec Replacement: Expertly remove and replace Kitec plumbing systems to prevent costly damages.",\n "Drain Services: Provide drain cleaning, unclogging, and sewer repair services to ensure proper drainage."\n ],\n "BusinessCategory": [\n "Plumbing Services",\n "Emergency Plumbing",\n "Residential and Commercial Plumbing"\n ],\n "FAQs": [\n {\n "question": "What types of plumbing services do you offer?",\n "answer": "We offer a wide range of plumbing services including emergency plumbing, residential and commercial plumbing, new construction plumbing, Kitec replacement, and drain services."\n },\n {\n "question": "Are your plumbers licensed and insured?",\n "answer": "Yes, all our plumbers are fully licensed and insured, ensuring that your plumbing needs are handled by qualified professionals."\n },\n {\n "question": "How quickly can you respond to a plumbing emergency?",\n "answer": "We provide 24/7 emergency plumbing services and can typically respond within the hour, depending on your location."\n },\n {\n "question": "What is Kitec plumbing and why should I replace it?",\n "answer": "Kitec plumbing is a type of piping that has been known to fail, leading to water damage. We specialize in its removal and replacement to prevent costly repairs."\n },\n {\n "question": "Do you provide free estimates for plumbing services?",\n "answer": "Yes, we offer free estimates for all our plumbing services, including new construction projects."\n }\n ],\n "TargetAudience": [\n {\n "segment": "Homeowners",\n "characteristics": "Individuals or families living in residential properties, often seeking reliable plumbing services for maintenance and emergencies.",\n "needs": "Dependable plumbing solutions, quick response times for emergencies, and transparent pricing."\n },\n {\n "segment": "Business Owners/Property Managers",\n "characteristics": "Professionals managing commercial properties or businesses that require ongoing plumbing maintenance and emergency services.",\n "needs": "Efficient plumbing solutions that minimize downtime, reliable service for multiple properties, and expertise in commercial plumbing."\n }\n ],\n "PrimaryAvatars": [\n {\n "name": "Emily Carter",\n "demographics": "35 years old, married with one child, homeowner in Oakville",\n "psychographics": "Values family comfort and safety, prefers reliable and quick service, concerned about home maintenance costs.",\n "painPoints": "Experiences frequent plumbing issues, needs trustworthy service providers, and is worried about unexpected repair costs."\n },\n {\n "name": "David Smith",\n "demographics": "42 years old, Facility Manager for a commercial property in Burlington",\n "psychographics": "Focuses on operational efficiency, values timely service, and seeks cost-effective solutions for plumbing needs.",\n "painPoints": "Requires immediate response for plumbing emergencies, needs to ensure tenant satisfaction, and faces budget constraints for maintenance."\n }\n ]\n}”,
“id”: “chatcmpl-9zRZ5S34jAyYYYAG7y98nc8e3tXPw”,
“object”: “chat.completion”,
“created”: “2024-08-23T16:36:35.000Z”,
“model”: “gpt-4o-mini-2024-07-18”,
“choices”: [
{
“index”: 0,
“message”: {
“role”: “assistant”,
“content”: "{\n "ThesisStatement": "ProResults Plumbing is dedicated to providing top-notch plumbing services, including 24/7 emergency support, residential and commercial plumbing, and specialized services like Kitec replacement, throughout the Greater Toronto Area. With a commitment to transparent pricing and exceptional customer care, they aim to raise the standard of local plumbing companies.",\n "CoreOfferings": [\n "24/7 Emergency Service: Provide immediate assistance for plumbing emergencies, ensuring quick resolution to urgent issues.",\n "Residential Plumbing: Offer comprehensive plumbing services for homeowners, including maintenance, repairs, and renovations.",\n "Commercial Plumbing: Deliver specialized plumbing solutions tailored for businesses, ensuring minimal disruption to operations.",\n "New Construction Plumbing: Handle all plumbing needs for new builds, from underground plumbing to fixture installation.",\n "Kitec Replacement: Expertly remove and replace Kitec plumbing systems to prevent costly damages.",\n "Drain Services: Provide drain cleaning, unclogging, and sewer repair services to ensure proper drainage."\n ],\n "BusinessCategory": [\n "Plumbing Services",\n "Emergency Plumbing",\n "Residential and Commercial Plumbing"\n ],\n "FAQs": [\n {\n "q

Nope try again. Starts with [ and ends with ] but the whole thing has to be code formatted. Can’t have curly quotes!

Would these instructions help? Alternatively you can save it in Notepad (not Wordpad) and upload the text files here.

1. This forum might have or already changed your text

When pasting text into this forum, you should format the JSON or example text using the rich-text editor, otherwise the forum software might modify the displayed text, and you might get incorrect answers from others because of it.

Some things this forum software might do to mangle your text:

– remove extra spaces (which may be necessary)
– convert links to titles (when copied is incorrect)
– incorrect joined links
– convert single and double quotes to smart angled quotes ()
– emojis
– etc.

This interferes with you receiving correct answers, because it:

– makes JSON invalid (you can verify when copy-paste into https://jsonformatter.org)
– makes incorrect text examples when we need to build a pattern for text parsing

2. To prevent this in future, please format text in code blocks

These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

3. You might need to re-copy the original text

Once the post has been submitted, it’s too late to format it since it’s already butchered, and you need to make a re-copy of the text, and format it before submitting the forum post.

Please let us know once you have corrected the issue. This will avoid others potentially providing wrong answers based on incorrect text in your question.

Thank you!

Thank you @alex.newpath and @samliew. Apologies for the late reply - between meals, putting kids to sleep, and other little chores I got sidetracked.

I ended up replacing the curly brackets with straight brackets and converting the JSON into plain text in this TextEdit file here:
Clean JSON.txt (9.0 KB)

I couldn’t save the original version because I had no more Cloud Storage :smiling_face_with_tear:.This really was the only way I could do this as each time I pasted the JSON from the ‘download output bundle’ from Make between the ```, I generated the same code I pasted earlier.

This is incorrect. You cannot use a single iterator for all three arrays like this.

You should not need an iterator if you just want to join each array item into a single cell.

Delete this Iterator and use the join function instead directly in the Sheets cell.

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

1 Like

Sam!!! Thank you so much!! Made a quick thank you video for you and @alex.newpath encapsulating what was achieved for this. I’m also starting to understand certain functions with array a lot more because of you both so genuinely…thank you thank you thank you

2 Likes

Right on. Well done and you learned a ton!

3 Likes