Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3669 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi There,

 

I'm trying to post data to a url which will then be imported to a web based application through an API.

 

I'm struggling to get this going using the insert from URL script step and using the following format for the URL:

 

httppost://myurl.com/post?sku=Products::sku&handle=Products::handle

 

Has anyone implemented this before and if so could you advise if I'm using the correct syntax for posting data to a URL?

 

Mark. 

Posted

 

 

httppost://myurl.com/post?sku=Products::sku&handle=Products::handle

 

 

 

Should be something more like:

 

"httppost://myurl.com/post?sku=" & Products::sku & "&handle=" & Products::handle

 

It is a mix of literal string and values from fields.

  • Like 1
Posted

Thanks for the feedback Wim

 

I made the changes to the insert url script step but I'm still getting error 3

 

At the moment it's a super simple script as I'm just trying to get the post part working.

 

Here's the script:

 

Go To Layout ["Product Details (Products)]

Insert from URL ["httppost://myurl.com/addproducts.php?sku=" & Products::sku & "&handle=" & Products::handle]

 

Last Error is error 3

 

Is there something I'm missing? All I'm trying to do is post the data to a URL so I can't see that I need anything else. the filemaker help doesn't go into much depth on this.

 

Mark

Posted

Ok I experimented some more and it seems that a field must be selected even though I wasn't after a response. 

 

Not getting error 3 anymore - new error but sorting that one out.

Posted

Well; that is what "insert…" means isn't it?

 

Insert into what?

 

Into the field you have selected in this script step; or into the field already selected by a script step or user action.

Which, in turn, also implies that the field you are inserting into must be on the layout, and must be a valid field for the current context.

Posted

Thanks Bruce,

 

I was doing research on posting FM records using FM - and what I found only reference using insert from URL as a posting method - wasn't aware it required a response to be inserted into a field as mandatory.

 

I think I just expected the FM would have a way to post data to a URL natively on it's own, A bit like an export feature but posting to a URL.

 

Either way, Thank you both for your feedback, It's set me on the right track now.

Posted

Filemaker does not have a HTTP POST method as such. You can post data as part of the Insert From URL[] and Import Records[] script steps. If you are not importing the response as records, then Insert From URL[] would make a better choice - and channeling the response to a field is good practice anyway, as it allows you to handle errors.

  • Like 1
  • 3 weeks later...
Posted

Thank you for your input.

 

I finally got this up and running. 

 

I'm able to post the data that I want to our web based POS system.

 

Now I'm trying to figure out how to handle the response. Will post a new topic to cover that though.

Posted

Hi there,

 

Wondering if anyone could provide a little guidance for me.

 

We are posting product data from filemaker to a web based pos system, (through a custom API connector we created) and then receiving a response.

 

This response contains full product data from the pos system.

 

What I'm trying to achieve is that I update a number of fields in my filemaker record with selected data from the response.

 

I'm trying to figure out if this can be handled through XML ie. we can configure the response to be any any format we like. So if we inserted the response as filemaker xml could I then update certain fields with that?

 

I can't seem to find a way to interpret the xml when using "Insert from url" though.

 

Would appreciate it if anyone has any suggestions or pointers to guide me.

 

Mark 

Posted

I merged your two topics, they are about the same need. Please do not create a new topic when working on the same need.

Posted

Thanks comment.

I'm trying to get my head around which way to do this now.

What I'm trying to do at the moment is create a new product in our pos system using an existing product in filemaker.

I'm posting the data from this new product record using 'insert from url' - that part is working.

The response I get back contains 4 values that I want to use to update 4 different fields in filemaker

What I'm trying to work out is the best way to format the response in order to update the fields.

I'm not sure whether using import will achieve what I'm after since I will only ever be doing this process on one single record at a time.m( the pos can only update a single record at a time)

I was thinking of formatting the response as a list then just extracting the values, but I was concerned that I wouldn't be able to easily check for errors.

I thought using xml and matching field names would cover some possible errors.

Posted
The response I get back contains 4 values that I want to use to update 4 different fields in filemaker

 

Assuming that's 4 fields in the current record, and that the record is either the only record in the found set or that there is a matching value in the response, I would still go with using Import Records[]. Parsing XML by hand, using text functions, is not something I would willingly undertake.

Posted

Got you. Basically using a script to find the current record, do an import, doing the http post as part of the import and parsing the response through a xml style sheet to update fields in the current record.

That makes sense. I get to work implementing that and see how it goes.

Thank you comment.

This topic is 3669 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.