UPDATED 8/29/2016
Thank you so much for everyone that responded and special thanks to Pierre.Vriens for the detailed explanation. I am sharing my answer in case anyone finds this useful.
After much research I found that the summary field was not available so I created my own summary (which is not nearly as good as the built in summary from Durpal) but it fits my own needs. It will break in the middle of a word but that is ok for me and also it breaks on 250 characters no matter what but that is ok in my case as well.
In my case I used the following for the facebook-description field (with php wrappers, or course).
print substr(strip_tags($node->body['und'][0]['value']), 0, 250) . " . . ."
thanks again to everyone!
----- original question -----
When I add a new article my facebook autopost uses the correct image, correct title, and the correct URL but the body summary is from the previous article?
If I rebuild the rules cache it works correctly but only for the next entry then I need to rebuild the rules cache again.
{ "rules_fb_new_artice" : {
"LABEL" : "FB - New Artice",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "facebook" ],
"REQUIRES" : [ "rules", "php", "fb_autopost_entity" ],
"ON" : { "node_insert--article" : { "bundle" : "article" } },
"DO" : [
{ "entity_create" : {
"USING" : {
"type" : "facebook_publication",
"param_type" : "post",
"param_user" : [ "site:current-user" ]
},
"PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-name" ],
"value" : [ "node:title" ]
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-picture" ],
"value" : "\u003C?php\r\n if($node-\u003Efield_image) {\r\n if(array_key_exists(0, $node-\u003Efield_image[\u0027und\u0027])) {\r\n $fid = $node-\u003Efield_image[\u0027und\u0027][0][\u0027fid\u0027];\r\n\t $result = db_select(\u0027file_managed\u0027, \u0027fm\u0027)\r\n\t\t-\u003Efields(\u0027fm\u0027, array(\u0027uri\u0027))\r\n\t\t-\u003Econdition(\u0027fm.fid\u0027, $fid,\u0027=\u0027)\r\n\t\t-\u003Eexecute()\r\n\t\t-\u003EfetchAssoc();\r\n $path = $result[\u0027uri\u0027];\r\n $style_name = \u0027large\u0027;\r\n print (image_style_url($style_name, $path));\r\n }\r\n }\r\n?\u003E"
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-link" ],
"value" : [ "node:url" ]
}
},
{ "data_set" : {
"data" : [ "entity-created:field-facebook-description" ],
"value" : [ "node:body:summary" ]
}
},
{ "publish_to_facebook" : {
"USING" : { "publication" : [ "entity-created" ], "pages" : "140044559353737" },
"PROVIDE" : { "facebook_publication_id" : { "facebook_publication_id" : "Facebook publication returned ID" } }
}
},
{ "entity_save" : { "data" : [ "entity-created" ] } }
]
}
}
Here is a screenprint of the above rule with proper formatting.
Some more details: When a new article is submitted a Facebook post is made using the article title, article url, article summary and article image.